package A1_4_Shopsystem;

// 商品类
public class Product {
    private String title;
    private double weight;
    private String description;
    private double unitPrice; // 商品单价

    public Product(String title, double weight, String description, double unitPrice) {
        this.title = title;
        this.weight = weight;
        this.description = description;
        this.unitPrice = unitPrice;
    }

    // 根据数量获取价格
    public double getPriceForQuantity(int quantity) {
        return unitPrice * quantity;
    }

    // 获取重量
    public double getWeight() {
        return weight;
    }

    // Getter 方法
    public String getTitle() {
        return title;
    }

    public double getWeightValue() {
        return weight;
    }

    public String getDescription() {
        return description;
    }

    public double getUnitPrice() {
        return unitPrice;
    }
}
